<?php

namespace maotool\src\test;

use maotool\util\ArrayUtil;
use PHPUnit\Framework\TestCase;

class ArrayUtilTest extends TestCase
{

    public function testDemo1()
    {
        $list = [
            "id" => 100,
        ];
        ArrayUtil::get($list, "id");
        $this->assertTrue(true);
    }

    public function testDemo2()
    {
        $list = [
            "id" => 100,
            "pid" => [
                "name" => "zhang",
                "list" => [
                    ["id" => 1, "name" => "xiao"],
                    ["id" => 2, "name" => "qi"],
                    ["id" => 3, "name" => "li"],
                ],
            ]
        ];
        $value = ArrayUtil::get($list, "pid.list.1.id");
        var_dump($value);
        $this->assertTrue(true);
    }

}